<?php
namespace app\service;
use think\Db;
class doorService{
    public function propertyInfo($property){
        return Db::name('property')->where('id',$property)->find();
    }
    public function serialInfo($locksnid){
        return Db::name('lock')->where('id',$locksnid)->value('serial');
    }
    public function recordList($whe,$page,$community_id){
        return Db::name('record')->where("community_id","in",$community_id)->where($whe)->order('showTime desc')->paginate(15, false, [
            'page'  =>  $page,
            'query' =>  $whe
        ]);
    }
    public function communityName($id){
        return Db::name('community')->where('id',$id)->value('name');
    }
    public function lockName($id){
        return Db::name('lock')->where('serial',$id)->value('lockname');
    }
    public function recordRelation($alipay){
        return Db::name('personnel')->where('alipay',$alipay)->value('relation');
    }
}